package com.techstar.ats.dxp.live.rep;

import java.util.LinkedList;
import java.util.List;

import com.techstar.ats.dxp.AtsMessage;
import com.techstar.ats.dxp.AtsResponse;
import com.techstar.ats.dxp.live.F04DeviceStatusBitmapType;

public class F04DeviceStatusBitmap extends AtsMessage implements AtsResponse {
	private static final long serialVersionUID = 1L;
	public final List<F04DeviceStatusBitmapType> types = new LinkedList<>();
	public int rtu;

	public boolean toCsvString(StringBuffer sb) {
		this.types.forEach((type) -> type.devices.forEach((device) -> {
			sb.append(this.line)
				.append(',')
				.append(this.rtu)
				.append(',')
				.append(type.devType)
				.append(',');
			device.toCsvString(sb);
			sb.append(',');
			type.toCsvString(sb);
			sb.append(System.lineSeparator());
		}));
		return false;
	}
}
